# -*-codeing = utf-8 -*-
# @Tine:2024/9/18 
# @Author:计科201121尚益帆
# File：3.6随机球.py
# @Software:PyCharm

import random


def draw_balls(times):
    balls = ['红'] * 3 + ['黄'] * 3 + ['蓝'] * 6
    results = []

    for _ in range(times):
        selected_balls = random.sample(balls, 8)
        result = {
            '红': selected_balls.count('红'),
            '黄': selected_balls.count('黄'),
            '蓝': selected_balls.count('蓝')
        }
        results.append(result)

    return results


times = int(input("请问您想随机选几次："))
results = draw_balls(times)

for i, result in enumerate(results):
    print("第{i + 1}次选取的为：红球{result['红']}个，黄球{result['黄']}个，蓝球{result['蓝']}个")
